<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\adminapi\validate\return_rule;


use app\common\validate\BaseValidate;


/**
 * ReturnRule验证器
 * Class ReturnRuleValidate
 * @package app\adminapi\validate
 */
class ReturnRuleValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'promotion_link_ids' => 'require',
        'platform' => 'require',
        'name' => 'require',
        'date_pattern' => 'require',
        'type' => 'require',
        'time' => 'require',
        'status' => 'require',
        'active' => 'require',
        'add_desktop' => 'require',
        'register' => 'require',
        'activity_order' => 'require',
        'key_behaviors' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'promotion_link_ids' => '推广链ID',
        'platform' => '快应用ID',
        'name' => '规则名称(渠道名称)',
        'date_pattern' => '日期模式 1：自然日 2:24小时 3：自定义',
        'type' => '上报口径 1首笔 2 全部',
        'time' => '生效时间',
        'status' => '状态 1开启 0关闭',
        'active' => '激活 1开启 0关闭',
        'add_desktop' => '加桌 1开启 0关闭',
        'register' => '注册 1开启 0关闭',
        'activity_order' => '活动订单 1开启 0关闭',
        'key_behaviors' => '关键行为 1开启 0关闭',
    ];


    /**
     * @notes 添加场景
     * @return ReturnRuleValidate
     * @author likeadmin
     * @date 2024/03/06 10:32
     */
    public function sceneAdd()
    {
        return $this->only(['promotion_link_ids','platform','date_pattern','type','active','add_desktop','register','activity_order','key_behaviors','time']);
    }


    /**
     * @notes 编辑场景
     * @return ReturnRuleValidate
     * @author likeadmin
     * @date 2024/03/06 10:32
     */
    public function sceneEdit()
    {
        return $this->only(['id','date_pattern','type','active','add_desktop','register','activity_order','key_behaviors','time']);
    }


    /**
     * @notes 删除场景
     * @return ReturnRuleValidate
     * @author likeadmin
     * @date 2024/03/06 10:32
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return ReturnRuleValidate
     * @author likeadmin
     * @date 2024/03/06 10:32
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 更改状态
     * @return ReturnRuleValidate
     * @author likeadmin
     * @date 2024/02/23 16:43
     */
    public function sceneStatus()
    {
        return $this->only(['id','status']);
    }
}
